package com.yzzrjy.data;

import com.qiniu.util.Auth;

public class QiNiu {
    public final static String QI_NIU_URL = "http://qiniu.yzyouyue.love/";
    public final static String SMALL_IMAGE = "-small_image";
    public final static String BIG_IMAGE = "-big_image";


    public static String accessKey = "AIfeAiiUoPNohOigLbLKg-HJgXDms5ZONhy0pxl3";
    public static String secretKey = "TWwpMLXDwVXp3E66PdCSdZPJ5MEb7u_MODvY0tod";
    public static String bucket = "yzyouyue";
    public static String getToken(){
        Auth auth = Auth.create(accessKey, secretKey);
        String upToken = auth.uploadToken(bucket);
        return upToken;
    }

    public static String getOriginalFileUrl(String remoteName){
        if(remoteName == null){
            return null;
        }
        return QI_NIU_URL + remoteName;
    }
    public static String getSmallImageUrl(String remoteName){
        if(remoteName == null){
            return null;
        }
        return QI_NIU_URL + remoteName + "-small_image";
    }

    public static String getBigImageUrl(String remoteName){
        if(remoteName == null){
            return null;
        }
        return QI_NIU_URL + remoteName + "-big_image";
    }
}
